<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>平台消耗对比</title>
    <#include "/header.html">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <script src="${request.contextPath}/statics/plugins/layui/layui.all.js"></script>
    <link rel="stylesheet" href="${request.contextPath}/statics/css/chartStyle.css">
    <script src="${request.contextPath}/statics/js/echarts.min.js"></script>
    <style>
        .bootstrap-select{
            width: 100% !important;
        }
        .glyphicon-arrow-up{
            color: red;
        }

        .glyphicon-arrow-down{
            color: #76d471;
        }
       .exportExcelBtn{
             padding: 6px 10px;
             background-color: #0C0C0C;
             color: #fff;
             font-size: 14px;
             border-radius: 2px;
         }
        .exportExcelBtn:hover{
            cursor: pointer;
        }
        .exportExcelBox{
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
<div id="index">
    <div class="layui-container" style="width: 100%;">
        <div class="layui-row" style="margin-top: 10px;">
            <div class="layui-col-md2 ">
                <select class="selectpicker" id="siteSelect" data-actions-box="true" title="请选择平台名称" multiple style="width:100%;" >

                </select>
            </div>
            <div class="layui-col-md2" style="padding-left: 20px;">
                <input type="text" class="form-control" required  id="startTime"  placeholder="请输入对比日期"  autocomplete="off" >
            </div>
            <div class="layui-col-md1" style="width: 50px;text-align: center;line-height: 35px;cursor: pointer;">
                <span class="fa fa-exchange fa-2x" onclick="switchover()"></span>
            </div>
            <div class="layui-col-md2" >
                <input type="text" class="form-control" required  id="endTime"  placeholder="请输入对比日期"  autocomplete="off" >
            </div>
            <div class="layui-col-md3 " style="padding-left: 20px;">
                <div class="btn btn-default" id="search" onclick="reload()">对比</div>
                <div class="btn-group" role="group" id="horizon">
                    <div class="btn btn-default" id="search1" data-id="1">近一周</div>
                    <div class="btn btn-default" id="search2" data-id="2">近一月</div>
                </div>
            </div>
        </div>
        <div class="row chartsBox" style="margin-top: 20px;">
                     <div class="col-md-12">
                         <#if shiro.hasPermission("platUseCompare:platUseCharts:exportExcel")>
                         <div class="exportExcelBox">
                             <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
                         </div>
                         </#if>
                         <div id="useUpCoinChart" style="width: 100%;height:370px;"></div>
                     </div>
         </div>
        <div class="row chartsBox" style="margin-top: 20px;">
                     <div class="col-md-12">
                         <#if shiro.hasPermission("platUseCompare:ipExpendCharts:exportExcel")>
                         <div class="exportExcelBox">
                             <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
                         </div>
                         </#if>
                         <div id="ipExpendChart" style="width: 100%;height:370px;"></div>
                     </div>
        </div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseCompare:forwardIncome:chartExport")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="forwardIncome5" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseCompare:h5Income:chartExport")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="h5Income5" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseCompare:forwardIpUse:chartExport")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="forwardIpUse5" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseCompare:h5IpUse:chartExport")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="h5IpUse5" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:forwardOutIncome:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat7" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:forwardInsideIncome:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat8" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:forwardOutIpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat9" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:forwardInsideIpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat10" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUse:newTotalIncome:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat1" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:newForwardIncome:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat2" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:newH5Income:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat3" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:newIpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat4" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:newForwardIpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat5" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("plat:newH5IpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat6" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseComapre:newForwardOutIncome:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat11" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseComapre:newForwardOutIncome:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat12" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseCompare:newForwardOutIpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat13" style="width: 100%;height:370px;"></div>
</div>
</div>
<div class="row chartsBox" style="margin-top: 20px;">
    <div class="col-md-12">
        <#if shiro.hasPermission("platUseCompare:newForwardInsideIpUse:exportExcel")>
        <div class="exportExcelBox">
            <span class="exportExcelBtn"><i class="fa fa-download" style="padding-right: 5px;"></i>导出</span>
        </div>
    </#if>
    <div id="plat14" style="width: 100%;height:370px;"></div>
</div>
</div>



   </div>
</div>
</body>
<script>
   $(function () {
       $('.selectpicker').selectpicker({
           'selectedText': 'cat',
           'noneSelectedText': '请选择',
           'deselectAllText': '全不选',
           'selectAllText': '全选'
       });
   })
    var tabindex = 0;
    var element = layui.element;
    function switchover(){
        var time = $('#startTime').val();
        $('#startTime').val($('#endTime').val())
        $('#endTime').val(time)
    }

    function toThousands(num) {
        var result = [ ], counter = 0;
        num = (num || 0).toString().split('');
        for (var i = num.length - 1; i >= 0; i--) {
            counter++;
            result.unshift(num[i]);
            if (!(counter % 3) && i != 0) { result.unshift(','); }
        }
        return result.join('');
    }

   var laydate = layui.laydate;
    laydate.render({
        elem: '#startTime',
        change:function(value, date, endDate){
            $('#horizon .btn').removeClass('active');
        }
    });
    laydate.render({
        elem: '#endTime',
       change:function(value, date, endDate){
            $('#horizon .btn').removeClass('active');
        }
    });
    $(function(){
       $('#horizon .btn').click(function(){
                if($(this).attr('data-id')==1){
                    $('#startTime').val(gettime(6))
                    $('#endTime').val(gettime(0))
                }else{
                    $('#startTime').val(gettime(29))
                    $('#endTime').val(gettime(0))
                }
                $('#horizon .btn').removeClass('active');
                $(this).addClass('active');
                reload()
            })
})
    function gettime(num){
        var _thisdate =new Date() - (1000*60 *60 *24*num)
        var date = new Date(_thisdate);
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
    }

    $.ajax({
        type : "get",
        url : baseURL+"platform/findAllPlatform",
        dataType : "json",
        success: function(data) {
            if(data.code==0){
                var _html = ''
                for(var i=0;i<data.platformList.length;i++){
                    _html = _html + '<option value="'+data.platformList[i].platformId+'">'+data.platformList[i].nickName+'</option>'
                }
                $('#siteSelect').append(_html);
                $('#siteSelect').selectpicker('refresh');

            }else{
                layer.msg('数据获取失败');
            }
        },
        error:function(){
            statsData = false;
            layer.msg('数据获取失败');
        }
    });

    function commonOption(id,title,legendArr,yTData,xAxis) {
        // console.log(legendArr);
        // console.log(yTData);
        // console.log(xAxis);
         // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById(id));
        // console.log(myChart)
        var  dataZoomOpt = [];
        var axLabel = {
            formatter:'{value}'
        };
       // 指定图表的配置项和数据
        var option = {
            title: {
                text: title
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985',
                        formatter:function (params) {
                            return parseFloat(params.value).toFixed(0)
                        }
                    }
                }
            },
            //color:['#2ec770','#1c97f5'],
            legend: {
                type: 'scroll',
                // orient: 'vertical',
                data:legendArr,
                left: '10%',
                right:'230px',
                top:'40px'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                top:'90px',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                name:'时间',
                nameLocation:'start',
                axisLabel: {
                    showMaxLabel: true
                },
                axisPointer:{
                    label:axLabel
                },
                data:xAxis
            },
            yAxis: {
                type: 'value',
                name:'数量'
            },
            color:['#2d8cf0','#19be6b', '#ff9900', '#e46cbb', '#9a66e4','#ed3f14','#CC9900','#9999FF','#996600','#009900','#336666','#666600','#9999CC'],
            series:yTData
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option,true);

    }
    init();
    function  init() {
        var week =  ["2018-12-13", "2018-12-14", "2018-12-15", "2018-12-16", "2018-12-17", "2018-12-18", "2018-12-19"];
        var lenged = ["叮咚转","趣转发"];
        var series = [
            {name: "叮咚转", type: "line", smooth: true, data: Array(7)},
            {name: "趣转发", type: "line", smooth: true, data: Array(7)}
        ];
        commonOption('useUpCoinChart','平台收益对比',lenged,series,week);
        commonOption('ipExpendChart','ip消耗对比',lenged,series,week);
        commonOption('forwardIncome5','转发区收益对比',lenged,series,week);
        commonOption('h5Income5','h5收益对比',lenged,series,week);
        commonOption('forwardIpUse5','转发区ip消耗对比',lenged,series,week);
        commonOption('h5IpUse5','h5ip消耗对比',lenged,series,week);
        commonOption('plat1','新广告系统收益',lenged,series,week);
        commonOption('plat2','新广告系统转发区收益',lenged,series,week);
        commonOption('plat3','新广告系统h5收益',lenged,series,week);
        commonOption('plat4','新广告系统ip消耗',lenged,series,week);
        commonOption('plat5','新广告系统转发区ip消耗',lenged,series,week);
        commonOption('plat6','新广告系统h5ip消耗',lenged,series,week);
        commonOption('plat7','转发区外部收益',lenged,series,week);
        commonOption('plat8','转发区内部收益',lenged,series,week);
        commonOption('plat9','转发区外部ip消耗',lenged,series,week);
        commonOption('plat10','转发区内部ip消耗',lenged,series,week);
        commonOption('plat11','新转发区外部收益',lenged,series,week);
        commonOption('plat12','新转发区内部收益',lenged,series,week);
        commonOption('plat13','新转发区外部ip消耗',lenged,series,week);
        commonOption('plat14','新转发区内部ip消耗',lenged,series,week);
     }
   function showNewForwardInsideIpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat14','新转发区外部ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewForwardOutIpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat13','新转发区外部ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewForwardInsideIncome6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat12','新转发区内部收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewForwardOutIncome6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat11','新转发区外部收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showForwardInsideIpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat10','转发区内部ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showForwardOutIpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat9','转发区外部ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showForwardInsideIncome6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat8','转发区内部收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showForwardOutIncome6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat7','转发区外部收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewH5IpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat6','新广告系统h5ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewForwardIpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat5','新广告系统转发区ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewIpUse6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat4','新广告系统ip消耗',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewH5Income6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat3','新广告系统h5收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewForwardIncome6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat2','新广告系统转发区收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
   function showNewTotalIncome6(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
       commonOption('plat1','新广告系统收益',saveData.legend,saveData.seriesData,data.xaxis);
   }
    function showH5IpUseChart(data) {
        var saveData = loopOpt(data.platformList,data.countList);
        // console.log(
        //     saveData
        // );
        commonOption('h5IpUse5','h5ip消耗对比',saveData.legend,saveData.seriesData,data.xaxis);
    }
    function showForwardIpUseChart(data) {
        var saveData = loopOpt(data.platformList,data.countList);
        // console.log(
        //     saveData
        // );
        commonOption('forwardIpUse5','转发区ip消耗对比',saveData.legend,saveData.seriesData,data.xaxis);
    }
    function showH5IncomeChart(data) {
        var saveData = loopOpt(data.platformList,data.countList);
        // console.log(
        //     saveData
        // );
        commonOption('h5Income5','h5收益对比',saveData.legend,saveData.seriesData,data.xaxis);
    }
    function showForwardIncomeChart(data) {
        var saveData = loopOpt(data.platformList,data.countList);
        // console.log(
        //     saveData
        // );
        commonOption('forwardIncome5','转发区收益对比',saveData.legend,saveData.seriesData,data.xaxis);
    }
   function  showChart(data) {
       var saveData = loopOpt(data.platformList,data.countList);
       // console.log(
       //     saveData
       // );
        commonOption('useUpCoinChart','平台收益对比',saveData.legend,saveData.seriesData,data.xaxis);
    }
    function  showIpExpend(data) {
        var saveData = loopOpt(data.platformList,data.countList);
        // console.log(
        //     saveData
        // );
        commonOption('ipExpendChart','ip消耗对比',saveData.legend,saveData.seriesData,data.xaxis);
    }
    function loopOpt(platFormList,countList) {
        var legendArr = [];
        //console.log(platFormList)
        platFormList.map(function (item) {
            legendArr.push(item.platformName);
        });
        var seriesData = [];
        for(var i = 0;i< platFormList.length;i++){
            for(var j = 0;j<countList.length;j++){
                if(platFormList[i].platformId == countList[j].platformId){
                    var obj = {
                        name:platFormList[i].nickName,
                        type:'line',
                        smooth: true,
                        data:countList[j].counts
                    };
                    seriesData.push(obj);
                }
            }
        };
        var params = {
            legend:legendArr,
            seriesData:seriesData
        };
        return params;
    }
   function getNewForwardInsideIpUse() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:newForwardInsideIpUse:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemForwardAreaInIpDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewForwardInsideIpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewForwardOutIpUse() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:newForwardOutIpUse:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemForwardAreaOutIpDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewForwardOutIpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewForwardInsideIncome() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:newForwardInsideIncome:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemForwardAreaInExpendPriceDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewForwardInsideIncome6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewForwardOutIncome() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:newForwardOutIncome:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemForwardAreaOutExpendPriceDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewForwardOutIncome6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getForwardInsideIpUse6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:forwardInsideIpUse:showCharts",
           url : baseURL + "articleStatisNew/getForwardAreaInCustomerIpStatisLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showForwardInsideIpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getForwardOutIpUse6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:forwardOutIpUse:showCharts",
           url : baseURL + "articleStatisNew/getForwardAreaOutCustomerIpStatisLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showForwardOutIpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getForwardInsideIncome6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:forwardInsideIncome:showCharts",
           url : baseURL + "articleStatisNew/getForwardAreaInArticleExpendLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showForwardInsideIncome6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getForwardOutIncome6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:forwardOutIncome:showCharts",
           url : baseURL + "articleStatisNew/getForwardAreaOutArticleExpendLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showForwardOutIncome6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewH5IpUse6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:newH5IpUse:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemH5IpDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewH5IpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewForwardIpUse6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:newForwardIpUse:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemForwardAreaIpDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewForwardIpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewIpUse6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:newIpUse:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemIpDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewIpUse6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewH5Income6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:newH5Income:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemH5ExpendPriceDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewH5Income6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewForwardIncome6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:newForwardIncome:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemForwardAreaExpendPriceDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewForwardIncome6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getNewTotalIncome6() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"plat:newTotalIncome:showCharts",
           url : baseURL + "articleStatisNew/getNewSystemExpendPriceDayLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showNewTotalIncome6(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getH5IpUseData() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:h5IpUse:showCharts",
           url : baseURL + "articleStatisNew/getH5CustomerIpStatisLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showH5IpUseChart(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getForwardIpUseData() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:forwardIpUse:showCharts",
           url : baseURL + "articleStatisNew/getForwardAreaCustomerIpStatisLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showForwardIpUseChart(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getH5IncomeData() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:h5Income:showCharts",
           url : baseURL + "articleStatisNew/getH5ForwardArticleExpendLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showH5IncomeChart(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
   function getForwardIncomeData() {
       var params = {
           startDate:$('#startTime').val(),
           endDate:$('#endTime').val(),
           platformId:$('#siteSelect').val()
       };
       ajaxc({
           type : "POST",
           permit:"platUseCompare:forwardIncome:showCharts",
           url : baseURL + "articleStatisNew/getForwardAreaArticleExpendLineChart",
           data:JSON.stringify(params),
           contentType : "application/json",
           success : function(r) {
               if (r.code === 0) {
                   showForwardIncomeChart(r.result);
               } else {
                   alert(r.msg);
               }
           }
       });
   }
    function getChartData() {
        var params = {
            startDate:$('#startTime').val(),
            endDate:$('#endTime').val(),
            platformId:$('#siteSelect').val()
        };
        $("#search").attr("disabled",'disabled');
        indexloading = layer.load(2);
        ajaxc({
            type : "POST",
            permit:"platUseUpCionPage:platUseUpCion:platUseUpCionChart",
            url : baseURL + "articleStatis/getForwardArticleExpendLineChart",
            data:JSON.stringify(params),
            contentType : "application/json",
            success : function(r) {
                if (r.code === 0) {
                    showChart(r.result);
                    $("#search").removeAttr("disabled");
                    layer.close(indexloading);
                } else {
                    alert(r.msg);
                }
            }
        });
    }
    function  getIpExpend() {
        var params = {
            startDate:$('#startTime').val(),
            endDate:$('#endTime').val(),
            platformId:$('#siteSelect').val()
        };
        ajaxc({
            type : "POST",
            permit:"ipExpendPage:ipExpend:ipExpendChart",
            url : baseURL + "articleStatis/getCustomerIpStatisLineChart",
            data:JSON.stringify(params),
            contentType : "application/json",
            success : function(r) {
                if (r.code === 0) {
                    showIpExpend(r.result);
                   } else {
                    alert(r.msg);
                }
            }
        });
    }
    function reload() {
        if(($('#startTime').val()==''||$('#endTime').val()=='')){
            layer.msg('时间格式不对')
            return;
        }
        getChartData();
        getIpExpend();
        getForwardIncomeData();
        getH5IncomeData();
        getForwardIpUseData();
        getH5IpUseData();
        getNewTotalIncome6();
        getNewForwardIncome6();
        getNewH5Income6();
        getNewIpUse6();
        getNewForwardIpUse6();
        getNewH5IpUse6();
        getForwardOutIncome6();
        getForwardInsideIncome6();
        getForwardOutIpUse6();
        getForwardInsideIpUse6();
        getNewForwardOutIncome();
        getNewForwardInsideIncome();
        getNewForwardOutIpUse();
        getNewForwardInsideIpUse();
}
    var indexloading;


</script>
</html>